package com.time.auth.infra.basic.service.impl;

import com.time.auth.common.utils.CollectionUtils;
import com.time.auth.infra.basic.entity.AuthPermission;
import com.time.auth.infra.basic.mapper.AuthPermissionDao;
import com.time.auth.infra.basic.service.AuthPermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * (AuthPermission)表服务实现类
 *
 * @author: HuangQi
 * @date: Created in 10:06 2025/9/25
 * @description: 权限服务实现类
 */
@Service("authPermissionService")
public class AuthPermissionServiceImpl implements AuthPermissionService {

    @Autowired
    private AuthPermissionDao authPermissionDao;

    @Override
    public Integer insert(AuthPermission authPermission) {
        return this.authPermissionDao.insert(authPermission);
    }

    @Override
    public Integer update(AuthPermission authPermission) {
        return this.authPermissionDao.update(authPermission);
    }

    @Override
    public List<AuthPermission> queryByPermisionIdList(List<Long> permissionIdList) {
        if (CollectionUtils.isEmpty(permissionIdList)) {
            return List.of();
        }
        return this.authPermissionDao.queryByPermisionIdList(permissionIdList);
    }
}
